package leetcode.weekly.week332;

//Solution1Test
public class Solution1 {

	public long findTheArrayConcVal(int[] nums) {
		long ans = 0;
		int l = 0, r = nums.length - 1;
		while (l <= r) {
			if (l == r) {
				return ans + 1l * nums[l];
			}
			int tmp = nums[r];
			long mul = 1;
			while (tmp > 0) {
				tmp /= 10;
				mul *= 10;
			}
			ans += 1l * nums[l] * mul + 1l * nums[r];
			l++;
			r--;
		}
		return ans;
	}
}
